package com.netx.ebs;
import java.util.TimerTask;
import com.netx.generics.basic.Context;


public class DaemonNotificationChecker extends TimerTask {
	private final EbsContext _ebsCtx;
	
	public DaemonNotificationChecker(EbsContext ebsCtx) {
		_ebsCtx = ebsCtx;
	}
	
	public void run() {
		try {
			Context.getRootLogger().info("starting notification-checker-daemon");
			_ebsCtx.internalGetSessionManager().clearNotificationsOlderThan(_ebsCtx.getNotificationKeepTime());
		}
		catch(Throwable t) {
			Context.getRootLogger().error(t);
		}
	}
}
